{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import xarray as xr \n",
    "import matplotlib.pyplot as plt\n",
    "import matplotlib.ticker as mticker\n",
    "import cmaps\n",
    "from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter\n",
    "import cartopy.crs as ccrs\n",
    "import cartopy.feature as cfeature\n",
    "from cartopy.io.shapereader import Reader\n",
    "from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER\n",
    "import numpy as np\n",
    "import metpy.calc as mycalc\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --xr-background-color: var(--jp-layout-color0, white);\n",
       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
       "}\n",
       "\n",
       "html[theme=dark],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
       "  --xr-border-color: #1F1F1F;\n",
       "  --xr-disabled-color: #515151;\n",
       "  --xr-background-color: #111111;\n",
       "  --xr-background-color-row-even: #111111;\n",
       "  --xr-background-color-row-odd: #313131;\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: '►';\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: '▼';\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: '(';\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: ')';\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: ',';\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  display: none;\n",
       "  background-color: var(--xr-background-color) !important;\n",
       "  padding-bottom: 5px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2 {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray &#x27;vo&#x27; (time: 120, latitude: 37, longitude: 37)&gt;\n",
       "[164280 values with dtype=float32]\n",
       "Coordinates:\n",
       "  * longitude  (longitude) float32 109.0 109.2 109.5 109.8 ... 117.5 117.8 118.0\n",
       "  * latitude   (latitude) float32 26.0 25.75 25.5 25.25 ... 17.5 17.25 17.0\n",
       "    level      int32 850\n",
       "  * time       (time) datetime64[ns] 2018-09-01 ... 2018-09-30T18:00:00\n",
       "Attributes:\n",
       "    units:          s**-1\n",
       "    long_name:      Vorticity (relative)\n",
       "    standard_name:  atmosphere_relative_vorticity</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'vo'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>time</span>: 120</li><li><span class='xr-has-index'>latitude</span>: 37</li><li><span class='xr-has-index'>longitude</span>: 37</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-93489534-5117-4a1c-ba69-340c47edb5d9' class='xr-array-in' type='checkbox' checked><label for='section-93489534-5117-4a1c-ba69-340c47edb5d9' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>...</span></div><div class='xr-array-data'><pre>[164280 values with dtype=float32]</pre></div></div></li><li class='xr-section-item'><input id='section-d955de28-1e7f-4dcb-b1ff-6e60bee53b72' class='xr-section-summary-in' type='checkbox'  checked><label for='section-d955de28-1e7f-4dcb-b1ff-6e60bee53b72' class='xr-section-summary' >Coordinates: <span>(4)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>longitude</span></div><div class='xr-var-dims'>(longitude)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>109.0 109.2 109.5 ... 117.8 118.0</div><input id='attrs-122a812f-0ab7-4023-b7a1-22152d2027f6' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-122a812f-0ab7-4023-b7a1-22152d2027f6' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-e76c4b07-a96b-4db2-9779-cf41c9c8d475' class='xr-var-data-in' type='checkbox'><label for='data-e76c4b07-a96b-4db2-9779-cf41c9c8d475' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>units :</span></dt><dd>degrees_east</dd><dt><span>long_name :</span></dt><dd>longitude</dd></dl></div><div class='xr-var-data'><pre>array([109.  , 109.25, 109.5 , 109.75, 110.  , 110.25, 110.5 , 110.75, 111.  ,\n",
       "       111.25, 111.5 , 111.75, 112.  , 112.25, 112.5 , 112.75, 113.  , 113.25,\n",
       "       113.5 , 113.75, 114.  , 114.25, 114.5 , 114.75, 115.  , 115.25, 115.5 ,\n",
       "       115.75, 116.  , 116.25, 116.5 , 116.75, 117.  , 117.25, 117.5 , 117.75,\n",
       "       118.  ], dtype=float32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>latitude</span></div><div class='xr-var-dims'>(latitude)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>26.0 25.75 25.5 ... 17.5 17.25 17.0</div><input id='attrs-ea75db29-a447-4e00-b93d-0759b1adc540' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-ea75db29-a447-4e00-b93d-0759b1adc540' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-5abc5676-05ab-45ac-b1c6-d5cc0dcd0b01' class='xr-var-data-in' type='checkbox'><label for='data-5abc5676-05ab-45ac-b1c6-d5cc0dcd0b01' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>units :</span></dt><dd>degrees_north</dd><dt><span>long_name :</span></dt><dd>latitude</dd></dl></div><div class='xr-var-data'><pre>array([26.  , 25.75, 25.5 , 25.25, 25.  , 24.75, 24.5 , 24.25, 24.  , 23.75,\n",
       "       23.5 , 23.25, 23.  , 22.75, 22.5 , 22.25, 22.  , 21.75, 21.5 , 21.25,\n",
       "       21.  , 20.75, 20.5 , 20.25, 20.  , 19.75, 19.5 , 19.25, 19.  , 18.75,\n",
       "       18.5 , 18.25, 18.  , 17.75, 17.5 , 17.25, 17.  ], dtype=float32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>level</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>int32</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-88b41ac0-23b9-4655-9acc-e29de02437ac' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-88b41ac0-23b9-4655-9acc-e29de02437ac' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-decfa780-b876-4686-bf91-d72020aa5549' class='xr-var-data-in' type='checkbox'><label for='data-decfa780-b876-4686-bf91-d72020aa5549' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>units :</span></dt><dd>millibars</dd><dt><span>long_name :</span></dt><dd>pressure_level</dd></dl></div><div class='xr-var-data'><pre>array(850)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>time</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>datetime64[ns]</div><div class='xr-var-preview xr-preview'>2018-09-01 ... 2018-09-30T18:00:00</div><input id='attrs-bf946851-61f1-45bf-a952-87e463fe0436' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-bf946851-61f1-45bf-a952-87e463fe0436' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-36ad3581-1d30-4db8-8c76-b5c55a3d1529' class='xr-var-data-in' type='checkbox'><label for='data-36ad3581-1d30-4db8-8c76-b5c55a3d1529' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>time</dd></dl></div><div class='xr-var-data'><pre>array([&#x27;2018-09-01T00:00:00.000000000&#x27;, &#x27;2018-09-01T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-01T12:00:00.000000000&#x27;, &#x27;2018-09-01T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-02T00:00:00.000000000&#x27;, &#x27;2018-09-02T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-02T12:00:00.000000000&#x27;, &#x27;2018-09-02T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-03T00:00:00.000000000&#x27;, &#x27;2018-09-03T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-03T12:00:00.000000000&#x27;, &#x27;2018-09-03T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-04T00:00:00.000000000&#x27;, &#x27;2018-09-04T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-04T12:00:00.000000000&#x27;, &#x27;2018-09-04T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-05T00:00:00.000000000&#x27;, &#x27;2018-09-05T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-05T12:00:00.000000000&#x27;, &#x27;2018-09-05T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-06T00:00:00.000000000&#x27;, &#x27;2018-09-06T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-06T12:00:00.000000000&#x27;, &#x27;2018-09-06T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-07T00:00:00.000000000&#x27;, &#x27;2018-09-07T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-07T12:00:00.000000000&#x27;, &#x27;2018-09-07T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-08T00:00:00.000000000&#x27;, &#x27;2018-09-08T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-08T12:00:00.000000000&#x27;, &#x27;2018-09-08T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-09T00:00:00.000000000&#x27;, &#x27;2018-09-09T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-09T12:00:00.000000000&#x27;, &#x27;2018-09-09T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-10T00:00:00.000000000&#x27;, &#x27;2018-09-10T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-10T12:00:00.000000000&#x27;, &#x27;2018-09-10T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-11T00:00:00.000000000&#x27;, &#x27;2018-09-11T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-11T12:00:00.000000000&#x27;, &#x27;2018-09-11T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-12T00:00:00.000000000&#x27;, &#x27;2018-09-12T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-12T12:00:00.000000000&#x27;, &#x27;2018-09-12T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-13T00:00:00.000000000&#x27;, &#x27;2018-09-13T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-13T12:00:00.000000000&#x27;, &#x27;2018-09-13T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-14T00:00:00.000000000&#x27;, &#x27;2018-09-14T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-14T12:00:00.000000000&#x27;, &#x27;2018-09-14T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-15T00:00:00.000000000&#x27;, &#x27;2018-09-15T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-15T12:00:00.000000000&#x27;, &#x27;2018-09-15T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-16T00:00:00.000000000&#x27;, &#x27;2018-09-16T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-16T12:00:00.000000000&#x27;, &#x27;2018-09-16T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-17T00:00:00.000000000&#x27;, &#x27;2018-09-17T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-17T12:00:00.000000000&#x27;, &#x27;2018-09-17T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-18T00:00:00.000000000&#x27;, &#x27;2018-09-18T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-18T12:00:00.000000000&#x27;, &#x27;2018-09-18T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-19T00:00:00.000000000&#x27;, &#x27;2018-09-19T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-19T12:00:00.000000000&#x27;, &#x27;2018-09-19T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-20T00:00:00.000000000&#x27;, &#x27;2018-09-20T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-20T12:00:00.000000000&#x27;, &#x27;2018-09-20T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-21T00:00:00.000000000&#x27;, &#x27;2018-09-21T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-21T12:00:00.000000000&#x27;, &#x27;2018-09-21T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-22T00:00:00.000000000&#x27;, &#x27;2018-09-22T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-22T12:00:00.000000000&#x27;, &#x27;2018-09-22T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-23T00:00:00.000000000&#x27;, &#x27;2018-09-23T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-23T12:00:00.000000000&#x27;, &#x27;2018-09-23T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-24T00:00:00.000000000&#x27;, &#x27;2018-09-24T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-24T12:00:00.000000000&#x27;, &#x27;2018-09-24T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-25T00:00:00.000000000&#x27;, &#x27;2018-09-25T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-25T12:00:00.000000000&#x27;, &#x27;2018-09-25T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-26T00:00:00.000000000&#x27;, &#x27;2018-09-26T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-26T12:00:00.000000000&#x27;, &#x27;2018-09-26T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-27T00:00:00.000000000&#x27;, &#x27;2018-09-27T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-27T12:00:00.000000000&#x27;, &#x27;2018-09-27T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-28T00:00:00.000000000&#x27;, &#x27;2018-09-28T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-28T12:00:00.000000000&#x27;, &#x27;2018-09-28T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-29T00:00:00.000000000&#x27;, &#x27;2018-09-29T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-29T12:00:00.000000000&#x27;, &#x27;2018-09-29T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-30T00:00:00.000000000&#x27;, &#x27;2018-09-30T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-30T12:00:00.000000000&#x27;, &#x27;2018-09-30T18:00:00.000000000&#x27;],\n",
       "      dtype=&#x27;datetime64[ns]&#x27;)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-efbe2079-a786-4192-aaaf-6ecf6dca0388' class='xr-section-summary-in' type='checkbox'  checked><label for='section-efbe2079-a786-4192-aaaf-6ecf6dca0388' class='xr-section-summary' >Attributes: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>units :</span></dt><dd>s**-1</dd><dt><span>long_name :</span></dt><dd>Vorticity (relative)</dd><dt><span>standard_name :</span></dt><dd>atmosphere_relative_vorticity</dd></dl></div></li></ul></div></div>"
      ],
      "text/plain": [
       "<xarray.DataArray 'vo' (time: 120, latitude: 37, longitude: 37)>\n",
       "[164280 values with dtype=float32]\n",
       "Coordinates:\n",
       "  * longitude  (longitude) float32 109.0 109.2 109.5 109.8 ... 117.5 117.8 118.0\n",
       "  * latitude   (latitude) float32 26.0 25.75 25.5 25.25 ... 17.5 17.25 17.0\n",
       "    level      int32 ...\n",
       "  * time       (time) datetime64[ns] 2018-09-01 ... 2018-09-30T18:00:00\n",
       "Attributes:\n",
       "    units:          s**-1\n",
       "    long_name:      Vorticity (relative)\n",
       "    standard_name:  atmosphere_relative_vorticity"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "RV=xr.open_dataset('./RV850_temp.nc')['vo']\n",
    "RV"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --xr-background-color: var(--jp-layout-color0, white);\n",
       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
       "}\n",
       "\n",
       "html[theme=dark],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
       "  --xr-border-color: #1F1F1F;\n",
       "  --xr-disabled-color: #515151;\n",
       "  --xr-background-color: #111111;\n",
       "  --xr-background-color-row-even: #111111;\n",
       "  --xr-background-color-row-odd: #313131;\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: '►';\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: '▼';\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: '(';\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: ')';\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: ',';\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  display: none;\n",
       "  background-color: var(--xr-background-color) !important;\n",
       "  padding-bottom: 5px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2 {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray &#x27;sp&#x27; (time: 120, expver: 2, latitude: 37, longitude: 37)&gt;\n",
       "[328560 values with dtype=float32]\n",
       "Coordinates:\n",
       "  * longitude  (longitude) float32 109.0 109.2 109.5 109.8 ... 117.5 117.8 118.0\n",
       "  * latitude   (latitude) float32 26.0 25.75 25.5 25.25 ... 17.5 17.25 17.0\n",
       "  * expver     (expver) int32 1 5\n",
       "  * time       (time) datetime64[ns] 2018-09-01 ... 2018-09-30T18:00:00\n",
       "Attributes:\n",
       "    units:          Pa\n",
       "    long_name:      Surface pressure\n",
       "    standard_name:  surface_air_pressure</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'sp'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>time</span>: 120</li><li><span class='xr-has-index'>expver</span>: 2</li><li><span class='xr-has-index'>latitude</span>: 37</li><li><span class='xr-has-index'>longitude</span>: 37</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-70f83714-a31e-40a1-afe0-73a5a6cee0da' class='xr-array-in' type='checkbox' checked><label for='section-70f83714-a31e-40a1-afe0-73a5a6cee0da' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>...</span></div><div class='xr-array-data'><pre>[328560 values with dtype=float32]</pre></div></div></li><li class='xr-section-item'><input id='section-3af4b769-26d0-46b4-a467-bbd3b6709a3c' class='xr-section-summary-in' type='checkbox'  checked><label for='section-3af4b769-26d0-46b4-a467-bbd3b6709a3c' class='xr-section-summary' >Coordinates: <span>(4)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>longitude</span></div><div class='xr-var-dims'>(longitude)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>109.0 109.2 109.5 ... 117.8 118.0</div><input id='attrs-f6c10292-487b-4c57-8e5d-aaa6a3aca74f' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-f6c10292-487b-4c57-8e5d-aaa6a3aca74f' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-53c628b1-ed68-4fb8-b24d-6864fcd544d1' class='xr-var-data-in' type='checkbox'><label for='data-53c628b1-ed68-4fb8-b24d-6864fcd544d1' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>units :</span></dt><dd>degrees_east</dd><dt><span>long_name :</span></dt><dd>longitude</dd></dl></div><div class='xr-var-data'><pre>array([109.  , 109.25, 109.5 , 109.75, 110.  , 110.25, 110.5 , 110.75, 111.  ,\n",
       "       111.25, 111.5 , 111.75, 112.  , 112.25, 112.5 , 112.75, 113.  , 113.25,\n",
       "       113.5 , 113.75, 114.  , 114.25, 114.5 , 114.75, 115.  , 115.25, 115.5 ,\n",
       "       115.75, 116.  , 116.25, 116.5 , 116.75, 117.  , 117.25, 117.5 , 117.75,\n",
       "       118.  ], dtype=float32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>latitude</span></div><div class='xr-var-dims'>(latitude)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>26.0 25.75 25.5 ... 17.5 17.25 17.0</div><input id='attrs-56bf4fb1-0105-4585-b5a8-f7a6092cd58b' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-56bf4fb1-0105-4585-b5a8-f7a6092cd58b' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-0a131ec6-1eee-4c11-bab9-ed927c0f4c02' class='xr-var-data-in' type='checkbox'><label for='data-0a131ec6-1eee-4c11-bab9-ed927c0f4c02' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>units :</span></dt><dd>degrees_north</dd><dt><span>long_name :</span></dt><dd>latitude</dd></dl></div><div class='xr-var-data'><pre>array([26.  , 25.75, 25.5 , 25.25, 25.  , 24.75, 24.5 , 24.25, 24.  , 23.75,\n",
       "       23.5 , 23.25, 23.  , 22.75, 22.5 , 22.25, 22.  , 21.75, 21.5 , 21.25,\n",
       "       21.  , 20.75, 20.5 , 20.25, 20.  , 19.75, 19.5 , 19.25, 19.  , 18.75,\n",
       "       18.5 , 18.25, 18.  , 17.75, 17.5 , 17.25, 17.  ], dtype=float32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>expver</span></div><div class='xr-var-dims'>(expver)</div><div class='xr-var-dtype'>int32</div><div class='xr-var-preview xr-preview'>1 5</div><input id='attrs-e012d1e3-0215-45fa-8a80-8b580f84a42b' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-e012d1e3-0215-45fa-8a80-8b580f84a42b' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-963c683f-b1e4-4096-b27a-c8bde5cbac9a' class='xr-var-data-in' type='checkbox'><label for='data-963c683f-b1e4-4096-b27a-c8bde5cbac9a' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>expver</dd></dl></div><div class='xr-var-data'><pre>array([1, 5])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>time</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>datetime64[ns]</div><div class='xr-var-preview xr-preview'>2018-09-01 ... 2018-09-30T18:00:00</div><input id='attrs-ed3d0bd4-059f-492d-ac6a-3b569d4967a0' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-ed3d0bd4-059f-492d-ac6a-3b569d4967a0' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-59dc7705-9bf1-49c2-9581-c58e5eb6527e' class='xr-var-data-in' type='checkbox'><label for='data-59dc7705-9bf1-49c2-9581-c58e5eb6527e' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>time</dd></dl></div><div class='xr-var-data'><pre>array([&#x27;2018-09-01T00:00:00.000000000&#x27;, &#x27;2018-09-01T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-01T12:00:00.000000000&#x27;, &#x27;2018-09-01T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-02T00:00:00.000000000&#x27;, &#x27;2018-09-02T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-02T12:00:00.000000000&#x27;, &#x27;2018-09-02T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-03T00:00:00.000000000&#x27;, &#x27;2018-09-03T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-03T12:00:00.000000000&#x27;, &#x27;2018-09-03T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-04T00:00:00.000000000&#x27;, &#x27;2018-09-04T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-04T12:00:00.000000000&#x27;, &#x27;2018-09-04T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-05T00:00:00.000000000&#x27;, &#x27;2018-09-05T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-05T12:00:00.000000000&#x27;, &#x27;2018-09-05T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-06T00:00:00.000000000&#x27;, &#x27;2018-09-06T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-06T12:00:00.000000000&#x27;, &#x27;2018-09-06T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-07T00:00:00.000000000&#x27;, &#x27;2018-09-07T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-07T12:00:00.000000000&#x27;, &#x27;2018-09-07T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-08T00:00:00.000000000&#x27;, &#x27;2018-09-08T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-08T12:00:00.000000000&#x27;, &#x27;2018-09-08T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-09T00:00:00.000000000&#x27;, &#x27;2018-09-09T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-09T12:00:00.000000000&#x27;, &#x27;2018-09-09T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-10T00:00:00.000000000&#x27;, &#x27;2018-09-10T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-10T12:00:00.000000000&#x27;, &#x27;2018-09-10T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-11T00:00:00.000000000&#x27;, &#x27;2018-09-11T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-11T12:00:00.000000000&#x27;, &#x27;2018-09-11T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-12T00:00:00.000000000&#x27;, &#x27;2018-09-12T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-12T12:00:00.000000000&#x27;, &#x27;2018-09-12T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-13T00:00:00.000000000&#x27;, &#x27;2018-09-13T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-13T12:00:00.000000000&#x27;, &#x27;2018-09-13T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-14T00:00:00.000000000&#x27;, &#x27;2018-09-14T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-14T12:00:00.000000000&#x27;, &#x27;2018-09-14T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-15T00:00:00.000000000&#x27;, &#x27;2018-09-15T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-15T12:00:00.000000000&#x27;, &#x27;2018-09-15T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-16T00:00:00.000000000&#x27;, &#x27;2018-09-16T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-16T12:00:00.000000000&#x27;, &#x27;2018-09-16T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-17T00:00:00.000000000&#x27;, &#x27;2018-09-17T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-17T12:00:00.000000000&#x27;, &#x27;2018-09-17T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-18T00:00:00.000000000&#x27;, &#x27;2018-09-18T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-18T12:00:00.000000000&#x27;, &#x27;2018-09-18T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-19T00:00:00.000000000&#x27;, &#x27;2018-09-19T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-19T12:00:00.000000000&#x27;, &#x27;2018-09-19T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-20T00:00:00.000000000&#x27;, &#x27;2018-09-20T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-20T12:00:00.000000000&#x27;, &#x27;2018-09-20T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-21T00:00:00.000000000&#x27;, &#x27;2018-09-21T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-21T12:00:00.000000000&#x27;, &#x27;2018-09-21T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-22T00:00:00.000000000&#x27;, &#x27;2018-09-22T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-22T12:00:00.000000000&#x27;, &#x27;2018-09-22T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-23T00:00:00.000000000&#x27;, &#x27;2018-09-23T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-23T12:00:00.000000000&#x27;, &#x27;2018-09-23T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-24T00:00:00.000000000&#x27;, &#x27;2018-09-24T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-24T12:00:00.000000000&#x27;, &#x27;2018-09-24T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-25T00:00:00.000000000&#x27;, &#x27;2018-09-25T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-25T12:00:00.000000000&#x27;, &#x27;2018-09-25T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-26T00:00:00.000000000&#x27;, &#x27;2018-09-26T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-26T12:00:00.000000000&#x27;, &#x27;2018-09-26T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-27T00:00:00.000000000&#x27;, &#x27;2018-09-27T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-27T12:00:00.000000000&#x27;, &#x27;2018-09-27T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-28T00:00:00.000000000&#x27;, &#x27;2018-09-28T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-28T12:00:00.000000000&#x27;, &#x27;2018-09-28T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-29T00:00:00.000000000&#x27;, &#x27;2018-09-29T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-29T12:00:00.000000000&#x27;, &#x27;2018-09-29T18:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-30T00:00:00.000000000&#x27;, &#x27;2018-09-30T06:00:00.000000000&#x27;,\n",
       "       &#x27;2018-09-30T12:00:00.000000000&#x27;, &#x27;2018-09-30T18:00:00.000000000&#x27;],\n",
       "      dtype=&#x27;datetime64[ns]&#x27;)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-6103f690-ad31-4811-8260-39c6e557325c' class='xr-section-summary-in' type='checkbox'  checked><label for='section-6103f690-ad31-4811-8260-39c6e557325c' class='xr-section-summary' >Attributes: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>units :</span></dt><dd>Pa</dd><dt><span>long_name :</span></dt><dd>Surface pressure</dd><dt><span>standard_name :</span></dt><dd>surface_air_pressure</dd></dl></div></li></ul></div></div>"
      ],
      "text/plain": [
       "<xarray.DataArray 'sp' (time: 120, expver: 2, latitude: 37, longitude: 37)>\n",
       "[328560 values with dtype=float32]\n",
       "Coordinates:\n",
       "  * longitude  (longitude) float32 109.0 109.2 109.5 109.8 ... 117.5 117.8 118.0\n",
       "  * latitude   (latitude) float32 26.0 25.75 25.5 25.25 ... 17.5 17.25 17.0\n",
       "  * expver     (expver) int32 1 5\n",
       "  * time       (time) datetime64[ns] 2018-09-01 ... 2018-09-30T18:00:00\n",
       "Attributes:\n",
       "    units:          Pa\n",
       "    long_name:      Surface pressure\n",
       "    standard_name:  surface_air_pressure"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "SP=xr.open_dataset('./SP_temp.nc')['sp']\n",
    "SP"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "61\n"
     ]
    }
   ],
   "source": [
    "timelist=SP.time.data\n",
    "num=0\n",
    "for i in timelist:\n",
    "    if '2018-09-16T06' in i.__str__() :\n",
    "        print(num)\n",
    "    num+=1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2018-09-16T06:00:00.000000000'"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "timelist[61].__str__()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([58, 59, 60, 61, 62, 63, 64])"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "timeselect=np.arange(61-3,61+4,1)\n",
    "timeselect"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "# levels=np.arange(6,61,2).tolist()\n",
    "# labels =[]\n",
    "# for i in levels:\n",
    "#     labels.append(str(i))\n",
    "# labels=tuple(labels)\n",
    "# levels1=[0]+np.arange(6,61,2).tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "lat=SP.latitude\n",
    "lon=SP.longitude\n",
    "levels=[0,7,10,13,16,19,22,25,28,31,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,69.4,74.7,80,85.4,90.7,96,100,105,110,115,120,125,130,135,140,145,150,155,160]\n",
    "colors=['#ffffff','#7ffdfc','#6feff8','#5be1de','#54cbd1','#38c0c3','#38a4c1','#219ea6','#108b95','#097595','#00b62a','#3dbc3d','#6dcc5b','#97e359','#d4ed70','#fffc89','#fdd952','#fea549','#ff6728','#fb370d','#f30b01','#d3010c','#a60402','#850201','#5e060b','#ae01fa','#b223f7','#c247fe','#d66af8','#de92fa','#f4b4fa','#fdd5fd','#fbcaea','#f8b7d8','#ffa2be','#ee9db3','#f88a96','#f6757a','#ff6172','#fb5d5b','#e2494e','#c63d51','#cc3a51','#b72347','#981b45']\n",
    "box1=[109,118,17,26]\n",
    "for t_i in timeselect:\n",
    "    fig = plt.figure(figsize=(10, 10))\n",
    "    ax = fig.subplots(1, 1, subplot_kw={'projection': ccrs.PlateCarree(central_longitude=113.5)})\n",
    "    ax.coastlines('50m')\n",
    "    ax.set_extent(box1,crs=ccrs.PlateCarree())\n",
    "\n",
    "    # 标注坐标轴\n",
    "    ax.set_xticks(np.arange(box1[0], box1[1] + 1, 1), crs=ccrs.PlateCarree())\n",
    "    ax.set_yticks(np.arange(box1[2], box1[3] + 1, 1), crs=ccrs.PlateCarree())\n",
    "\n",
    "    # 经纬度格式，把0经度设置不加E和W\n",
    "    lon_formatter = LongitudeFormatter(zero_direction_label=False)\n",
    "    lat_formatter = LatitudeFormatter()\n",
    "    ax.gridlines(xlocs=np.arange(box1[0], box1[1] + 1, 1), ylocs=np.arange(box1[2], box1[3] + 1, 1), linestyle=':', linewidth=0.3, x_inline=False, y_inline=False, color='k')\n",
    "    ax.xaxis.set_major_formatter(lon_formatter)\n",
    "    ax.yaxis.set_major_formatter(lat_formatter)\n",
    "\n",
    "    # 绘制\n",
    "    smoothSP=mycalc.smooth_gaussian(SP.loc[timelist[t_i].__str__(),1,:,:]/100,9)\n",
    "    line=ax.contour(lon,lat,smoothSP,levels=np.arange(892,1006,4),colors='#5d122b',transform=ccrs.PlateCarree(),alpha=0.5,)\n",
    "    ax.clabel(line, inline=True, fontsize=10, fmt='%.0f')\n",
    "    colorbar=ax.contourf(lon,lat,RV.loc[timelist[t_i].__str__(),:,:]*10**5,levels=levels,colors=colors,transform=ccrs.PlateCarree())\n",
    "    cb=plt.colorbar(colorbar,extendrect='True',pad=0.005,fraction=0.15, shrink=0.83,aspect=30,location='right')\n",
    "    cb.set_ticks([7,16,25,34,40,46,52,58,64,80,96,110,125,140,155])\n",
    "    cb.set_ticklabels(('7','16','25','34','40','46','52','58','64','80','96','110','125','140','155'))\n",
    "    \n",
    "    plt.savefig('./tygif/'+str(t_i)+'.png',dpi=300)\n",
    "    plt.close()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['58.png', '59.png', '60.png', '61.png', '62.png', '63.png', '64.png']\n"
     ]
    }
   ],
   "source": [
    "# 动图制作\n",
    "from PIL import Image\n",
    "import os\n",
    "imgFiles = [fn for fn in os.listdir('./tygif/') if fn.endswith('.png')]\n",
    "imgFiles.sort()\n",
    "print(imgFiles)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "images = [Image.open('./tygif/'+fn) for fn in imgFiles]\n",
    "im = images[0]\n",
    "filename = './tygif/test.gif'\n",
    "im.save(fp=filename, format='gif', save_all=True, append_images=images[1:], duration=100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['2022_11_19_0800.jpg', '2022_11_19_2000.jpg', '2022_11_20_0800.jpg', '2022_11_20_2000.jpg', '2022_11_21_0800.jpg', '2022_11_21_2000.jpg', '2022_11_22_0800.jpg', '2022_11_22_2000.jpg', '2022_11_23_0800.jpg', '2022_11_23_2000.jpg', '2022_11_24_0800.jpg', '2022_11_24_2000.jpg', '2022_11_25_0800.jpg', '2022_11_25_2000.jpg', '2022_11_26_0800.jpg']\n"
     ]
    }
   ],
   "source": [
    "# 动图制作\n",
    "from PIL import Image\n",
    "import os\n",
    "imgFiles = [fn for fn in os.listdir('D:\\picture\\亚欧\\\\500hPa\\\\2022\\\\11\\\\') if fn.endswith('.jpg')]\n",
    "imgFiles.sort()\n",
    "print(imgFiles)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "images = [Image.open('D:\\picture\\亚欧\\\\500hPa\\\\2022\\\\11\\\\'+fn) for fn in imgFiles]\n",
    "im = images[8]\n",
    "filename = 'D:\\picture\\亚欧\\\\500hPa\\\\2022\\\\11\\\\test.gif'\n",
    "im.save(fp=filename, format='gif', save_all=True, append_images=images[9:], duration=500)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on method save in module PIL.Image:\n",
      "\n",
      "save(fp, format=None, **params) method of PIL.JpegImagePlugin.JpegImageFile instance\n",
      "    Saves this image under the given filename.  If no format is\n",
      "    specified, the format to use is determined from the filename\n",
      "    extension, if possible.\n",
      "    \n",
      "    Keyword options can be used to provide additional instructions\n",
      "    to the writer. If a writer doesn't recognise an option, it is\n",
      "    silently ignored. The available options are described in the\n",
      "    :doc:`image format documentation\n",
      "    <../handbook/image-file-formats>` for each writer.\n",
      "    \n",
      "    You can use a file object instead of a filename. In this case,\n",
      "    you must always specify the format. The file object must\n",
      "    implement the ``seek``, ``tell``, and ``write``\n",
      "    methods, and be opened in binary mode.\n",
      "    \n",
      "    :param fp: A filename (string), pathlib.Path object or file object.\n",
      "    :param format: Optional format override.  If omitted, the\n",
      "       format to use is determined from the filename extension.\n",
      "       If a file object was used instead of a filename, this\n",
      "       parameter should always be used.\n",
      "    :param params: Extra parameters to the image writer.\n",
      "    :returns: None\n",
      "    :exception ValueError: If the output format could not be determined\n",
      "       from the file name.  Use the format option to solve this.\n",
      "    :exception OSError: If the file could not be written.  The file\n",
      "       may have been created, and may contain partial data.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(im.save)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.10.4 ('py310')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.4"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "1af7d1ae3c55d82bbda2a5569c7a9f2f2d33ff4c43dd1c666120ac4867346c8c"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
